<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>
    <div id="app">
        <!--阻止事件冒泡 .stop-->
        <div @click="divClick">
            <button @click.stop="btnClick"></button>
        </div>
        <!--阻止默认事件-->
        <form action="baidu">
            <button type="submit">提交</button>
        </form>
        <form action="baidu">
            <input type="submit" value="提交" @click.prevent="submitClick">
        </form>
        <!--监听某个键盘的键帽-->
        <label>
    <input type="text" v-on:keyup.enter="keyUp">
  </label>

    </div>
    <script src="../js/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                message: "你好",
            },
            methods: {
                divClick() {
                    console.log("divClick")
                },
                btnClick() {
                    console.log('btnClick')
                },
                submitClick() {
                    console.log('ssss')
                },
                keyUp() {
                    console.log("ddcd")
                }
            }
        })
    </script>
</body>

</html>